package com.maven.springmvc.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@RequestMapping("/calc")
@Controller
public class CalculateController {

    @ResponseBody
    @RequestMapping("/sum")
    // 首先这里的 参数 应该与 前端的名称一样
    public String sum(Integer num1,Integer num2) {
        Integer sum = num1 + num2;
        return " 相加结果为 ：" +sum;
    }

}
